        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/tree.css" />
         <style>
			a{color:#000}
			a,a:link,a:hover{text-decoration:none}
        </style>
        <script type="text/javascript">
            $(function() {
                $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
                $('.tree li.parent_li > span').on('click', function(e) {
                    var children = $(this).parent('li.parent_li').find(' > ul > li');
                    if (children.is(":visible")) {
                        children.hide('fast');
                        $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
                    } else {
                        children.show('fast');
                        $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
                    }
                    e.stopPropagation();
                });
            });
           
        </script>

 
    <body>


		<?php if($html){ ?>
		<div style="float:right">
			<a class="fi-help-text btn btn-primary" id="showall" >展开</a>
			<a class="fi-help-text btn btn-primary" id="hideall" >收回</a>
		</div>
		<?php } ?>

	
			
		<?php if($html){ ?>
		<div class="tree well">
	        {$html}
	    </div>
		<?php } ?>
    
    <script>
    $(document).ready(function(){
    	
 
    	});
    $("#hideall").on('click',function(){
    	 $('.tree li.parent_li > span').parent('li.parent_li').find(' > ul > li').hide('fast');
    });
    $("#showall").on('click',function(){
   	 $('.tree li.parent_li > span').parent('li.parent_li').find(' > ul > li').show('fast');
   })
  //根据手机号码/姓名匹配用户
    $("#username").keyup(function(){
    	var str = $(this).val();
    	var self = $(this);
    	var dom = $(".matchs");
    	if(str){
    		$.ajax({
    			url:"/admin/common/matchmember",
    			type:"post",
    			data:{str:str},
    			dataType:"json",
    			success:function(data){
    				var memberJson = {};
    				dom.html("");
    				$.each(data,function(){
    					//memberAccount = data;
    					memberJson[this.uid] = this;
    					var html = '<div class="match" data-uid='+this.uid+'  style="padding:5px 20px;background-color:#D3D3D3;border-bottom:2px solid white;" >姓名：'+this.realname+' 手机号码：'+this.mobile+'</div>';
    					dom.append(html);
    				});
    				$(".match").on("click",function(){
    					
    					var uid = $(this).attr('data-uid');
    					$("#uid").val(uid);		
    					self.val((memberJson[uid].realname?memberJson[uid].realname:memberJson[uid].nickname));
    					dom.html("");
    				});
    			
    			},
    			error:function(){
    				dom.html("");
    				$("#uid").val('');	
    			}
    		});
    	}else{
    		dom.html("");
    		$("#uid").val('');	
    	}
    });
    </script>
    
    </body>


      